home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 652 < prev    next >
Internet Message Format  |  1996-08-06  |  1KB

  1. Path: castle.nando.net!news
  2. From: actuary@nando.net   (Bill McCarthy)
  3. Newsgroups: comp.std.c
  4. Subject: Re: EXIT_SUCCES != EXIT_FAILURE?
  5. Date: 26 Mar 1996 03:43:21 GMT
  6. Organization: Nando.net Public Access
  7. Message-ID: <4j7p4p$4n8@castle.nando.net>
  8. References: <tompa.827763954@news>
  9. Reply-To: actuary@nando.net (Bill McCarthy)
  10. NNTP-Posting-Host: grail806.nando.net
  11. X-Newsreader: IBM NewsReader/2 v1.2
  12.  
  13. In <tompa.827763954@news>, tompa@ida.liu.se (Thomas Padron-McCarthy) writes:
  14. >Hi!
  15. >
  16. >Many of the students in a C course I teach have started to use
  17. >EXIT_SUCCESS and EXIT_FAILURE as return values from functions
  18. >(other than main).
  19. >
  20. >I have never used EXIT_SUCCESS and EXIT_FAILURE for anything
  21. >else than as the return value from main, and as the argument to exit.
  22. >
  23. >I don't like this new practice, but questions of style are difficult.
  24. >So I wonder: Does the standard guarantee that EXIT_SUCCESS and
  25. >EXIT_FAILURE are different?
  26. >
  27. >I have looked in my old ANSI X3-159-1989,
  28. >but I guess I'm not smart enough to understand it...
  29.  
  30. Not only are they not guaranteed to be different.  EXIT_SUCCESS is
  31. not guaranteed to be zero, and EXIT_FAILURE is not guaranteed to
  32. be different from 0.  They are implementation defined and should
  33. only be used as an argument to exit() or in a return from main().
  34.  
  35. They are defined 7.10.4.3 of the standard.
  36.  
  37. Bill McCarthy
  38. actuary@nando.net
  39. Wendell, NC  USA
  40.  
  41.